package com.vincent.kdp.ui.notice.repository;

import com.loopj.android.http.RequestParams;
import com.vincent.baseapp.util.SPUtil;
import com.vincent.kdp.PostUrl;
import com.vincent.kdp.http.HttpUtil;
import com.vincent.kdp.http.RequestCallBack;
import com.vincent.kdp.ui.bean.response.BaseOutput;
import com.vincent.kdp.ui.bean.response.NoticeAgentMatterListOutput;
import com.vincent.kdp.ui.bean.response.NoticeNumOutput;
import com.vincent.kdp.util.BaseParam;

public class NoticeRepository {
    /**
     * 获取热门商品列表
     *
     * @param callBack 回调方法
     */
    public void reqNoticeAgentMatterList(int pageNum,String employeeId,String type , RequestCallBack callBack) {
        RequestParams params = new RequestParams();
        params.put("number", BaseParam.getDeviceId());
        params.put("employeeId",employeeId);
        params.put("type",type);
        params.put("pageNum",pageNum);
        HttpUtil.loadData(PostUrl.NOTICE_AGENT_MATER_LIST, params, NoticeAgentMatterListOutput.class, callBack);
    }


    public void reqAgentMatterList(int pageNum,String employeeId,String type , RequestCallBack callBack) {
        RequestParams params = new RequestParams();
        params.put("number", BaseParam.getDeviceId());
        params.put("employeeId",employeeId);
        params.put("type",type);
        params.put("pageNum",pageNum);
        HttpUtil.loadData(PostUrl.GET_AGENT_MATTER_LIST, params, NoticeAgentMatterListOutput.class, callBack);
    }

    public void reqHavingNoticeNum(RequestCallBack callBack){
        RequestParams params = new RequestParams();
        params.put("employeeId", SPUtil.getString("empId"));
        HttpUtil.loadData(PostUrl.NOTICE_ALL_COUNT_NUM, params, NoticeNumOutput.class, callBack);
    }
    public void reqCountNoticeNum(String type,RequestCallBack callBack){
        RequestParams params = new RequestParams();
        params.put("number", BaseParam.getDeviceId());
        params.put("employeeId", SPUtil.getString("empId"));
        params.put("type",type);
        HttpUtil.loadData(PostUrl.NOTICE_COUNT_NUM, params, NoticeNumOutput.class, callBack);
    }

    public void reqGetNotice(String id,RequestCallBack callBack){
        RequestParams params = new RequestParams();
        params.put("id",id);
        HttpUtil.loadData(PostUrl.GET_NOTICE, params, BaseOutput.class, callBack);
    }

}
